﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Reflection;
using ArtOfTest.WebAii.Controls.HtmlControls;
using ArtOfTest.WebAii.Controls.HtmlControls.HtmlAsserts;
using ArtOfTest.WebAii.Core;
using ArtOfTest.WebAii.ObjectModel;

using ArtOfTest.WebAii.TestAttributes;
using ArtOfTest.WebAii.TestTemplates;

using ArtOfTest.WebAii.Silverlight;
using ArtOfTest.WebAii.Silverlight.UI;
using System.Diagnostics;
using Utilities;

namespace SM2ObjectRunner
{
    public class ORunner
    {
        public void run()
        {
            //Get namespace
            string strDllName = "SM2" + Utilities.GlobalTestStep.strObject + ".dll";
            string strClassName = "SM2" + Utilities.GlobalTestStep.strObject + ".SM2";

            //RUNNING
            Assembly asblNameSpace = Assembly.LoadFrom(strDllName);
            Type typeOfClass = asblNameSpace.GetType(strClassName);
            IObject iobject = (IObject)Activator.CreateInstance(typeOfClass);          
            
            //Core running            
            iobject.run(Utilities.GlobalTestStep.strAction);
        }    
    }
}
